<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>管理员列表</title>
    <link rel="stylesheet" href="__ADMIN__/vendor/layui/css/layui.css">
    <link rel="stylesheet" href="__ADMIN__/custom/css/style.css">
</head>
<body style="padding:10px 10px;">
<table class="layui-table" lay-size="sm">
    <colgroup>
        <col width="80">
        <col>
        <col width="100">
        <col width="150">
    </colgroup>
    <thead>
    <tr>
        <th style="text-align: center;">ID</th>
        <th>账号</th>
        <th>状态</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    {volist name="manager" id="vo"}
    <tr>
        <td style="text-align: center;">{$vo.id}</td>
        <td>{$vo.account}</td>
        <td>{$vo.state?'<span class="layui-badge layui-bg-green">正常</span>':'<span class="layui-badge">锁定</span>'}</td>
        <td><a href="{:url('manager/edit',['id'=>$vo['id']])}" class="layui-btn layui-btn-warm layui-btn-mini">编辑</a><a href="{:url('manager/del',['id'=>$vo.id])}" class="layui-btn layui-btn-danger layui-btn-mini del">删除</a></td>
    </tr>
    {/volist}
    </tbody>
</table>
<div>{$manager->render()}</div>
<script src="__ADMIN__/vendor/js/jquery.js"></script>
<script src="__ADMIN__/vendor/layui/layui.js"></script>
<script src="__ADMIN__/custom/js/admin.js"></script>
<script>
    layui.use('layer', function(){
        var layer = layui.layer;
        $('.del').on('click',function () {
            var url=$(this).attr('href');
            layer.confirm('确定要删除该管理员吗?', {icon: 3, title:'温馨提示'}, function(index){
                //do something
                location.href=url;
                layer.close(index);
            });
            return false;
        })
    });
    $(function(){
        $(window.parent.document).find('#righttitle').text($('title').text());
   });
</script>
</body>
</html>